package com.huang.CAS;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicIntegerArray;

public class AtomicIntegerArrayDemo {

    public static void main(String[] args) {

       AtomicIntegerArray array=new AtomicIntegerArray(new int[]{1,2,3});


        new Thread(()->{

            int andIncrement = array.getAndIncrement(2);
            System.out.println(andIncrement);
        }).start();

    }
}
